home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / a_man / cat7 / termio.z / termio
Encoding:
Text File  |  2001-04-17  |  79.7 KB  |  1,387 lines

  1.  
  2.  
  3.  
  4. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      termio, termios - general terminal interfaces
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.    ####iiiinnnncccclllluuuuddddeeee <<<<tttteeeerrrrmmmmiiiioooossss....hhhh>>>>
  13.  
  14.      iiiiooooccccttttllll ((((iiiinnnntttt ffffiiiillllddddeeeessss,,,, iiiinnnntttt rrrreeeeqqqquuuueeeesssstttt,,,, ssssttttrrrruuuucccctttt tttteeeerrrrmmmmiiiioooossss ****aaaarrrrgggg))));;;;
  15.  
  16.      iiiiooooccccttttllll ((((iiiinnnntttt ffffiiiillllddddeeeessss,,,, iiiinnnntttt rrrreeeeqqqquuuueeeesssstttt,,,, iiiinnnntttt aaaarrrrgggg))));;;;
  17.  
  18.    ####iiiinnnncccclllluuuuddddeeee <<<<tttteeeerrrrmmmmiiiioooo....hhhh>>>>
  19.  
  20.      iiiiooooccccttttllll ((((iiiinnnntttt ffffiiiillllddddeeeessss,,,, iiiinnnntttt rrrreeeeqqqquuuueeeesssstttt,,,, ssssttttrrrruuuucccctttt tttteeeerrrrmmmmiiiioooo ****aaaarrrrgggg))));;;;
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      All of the asynchronous communications ports use the same general
  24.      interface, no matter what hardware is involved.  The user interface to
  25.      this functionality is via the _i_o_c_t_l calls described below, or the POSIX
  26.      _t_e_r_m_i_o_s interface described in _t_e_r_m_i_o_s(3t).  The remainder of this
  27.      section discusses the common features of the terminal subsystem which are
  28.      relevant to both of these interfaces.
  29.  
  30.  
  31.    RRRReeeecccceeeennnntttt cccchhhhaaaannnnggggeeeessss
  32.      The tttteeeerrrrmmmmiiiioooo and tttteeeerrrrmmmmiiiioooossss structures have been changed to support bit rates
  33.      of greater than 38400 bps.  Each of these structures has two new members
  34.      _c__o_s_p_e_e_d and _c__i_s_p_e_e_d which store the output and input bit rates,
  35.      respectively.  They replace the CCCCBBBBAAAAUUUUDDDD and CCCCIIIIBBBBAAAAUUUUDDDD fields of the _c__c_f_l_a_g
  36.      member.  CCCCBBBBAAAAUUUUDDDD and CCCCIIIIBBBBAAAAUUUUDDDD should no longer be modified or examined by
  37.      applications.  (Because no current SGI hardware supports setting input
  38.      and output to different rates, _c__i_s_p_e_e_d is currently unsupported.
  39.      Applications should either not modify it, or should set it to the same
  40.      value as _c__o_s_p_e_e_d.)
  41.  
  42.      Unlike CCCCBBBBAAAAUUUUDDDD and CCCCIIIIBBBBAAAAUUUUDDDD, _c__o_s_p_e_e_d and _c__i_s_p_e_e_d encode bit rates as plain
  43.      integers.  To set a bit rate of 38400 bits per second, an application
  44.      would set _c__o_s_p_e_e_d to the integer value 38400.  For convenience, macros
  45.      such as BBBB33338888444400000000 have been provided for several common bit rates.
  46.  
  47.      Note that the capabilities of various serial port hardware differ; many
  48.      still do not support rates greater than 38400 bps (see _s_e_r_i_a_l(_7) for more
  49.      information on different serial port types.)  Applications therefore need
  50.      to check the return values of library calls that attempt to set bit rates
  51.      (such as iiiiooooccccttttllll described here) , because the calls may now fail in more
  52.      situations than before.
  53.  
  54.  
  55.    CCCCoooonnnnttttrrrroooolllllllliiiinnnngggg TTTTeeeerrrrmmmmiiiinnnnaaaallll
  56.      When a terminal file is opened, it normally causes the process to wait
  57.      until a connection is established.  In practice, users' programs seldom
  58.      open terminal files; they are opened by the system and become a user's
  59.      standard input, output and error files.  The very first terminal file
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  71.  
  72.  
  73.  
  74.      opened by the session leader which is not already associated with a
  75.      session becomes the controlling terminal for the session.
  76.  
  77.      If a process does not wish to acquire the terminal as a controlling
  78.      terminal (as is the case with many daemons that open ////ddddeeeevvvv////ccccoooonnnnssssoooolllleeee), the
  79.      process should add the OOOO____NNNNOOOOCCCCTTTTTTTTYYYY flag into the second argument bitmask to
  80.      _o_p_e_n(2).
  81.  
  82.      The controlling terminal is inherited by the child process during a
  83.      _f_o_r_k(2).  A process can break this association by changing its session
  84.      using _s_e_t_s_i_d(2).  (Currently, this also happens if a process issues a
  85.      System V _s_e_t_p_g_r_p() or _B_S_D_s_e_t_p_g_r_p(mypid, 0).  This provides backward
  86.      compatibility with SVR3 and BSD4.3).
  87.  
  88.      When a session leader that has a controlling terminal exits, the SSSSIIIIGGGGHHHHUUUUPPPP
  89.      signal will be sent to each process in the foreground process group of
  90.      the controlling terminal and the controlling terminal will be
  91.      disassociated from the current session. This allows the terminal to be
  92.      acquired by a new session leader. Subsequent access to the terminal by
  93.      other processes in the earlier session will fail, returning the error
  94.      code EEEEIIIIOOOO.
  95.  
  96.    SSSSeeeessssssssiiiioooonnnn MMMMaaaannnnaaaaggggeeeemmmmeeeennnntttt ((((JJJJoooobbbb CCCCoooonnnnttttrrrroooollll))))
  97.      A controlling terminal will designate one of the process groups in the
  98.      session associated with it as the ffffoooorrrreeeeggggrrrroooouuuunnnndddd process group.  All other
  99.      process groups in the session are designated as bbbbaaaacccckkkkggggrrrroooouuuunnnndddd process
  100.      groups.  The foreground process group plays a special role in handling
  101.      signal-generating input characters, as discussed below.  By default, when
  102.      a controlling terminal is allocated, the controlling process's process
  103.      group is assigned as the foreground process group.
  104.  
  105.      Background process groups in the controlling process's session are
  106.      subject to a job control line discipline when they attempt to access
  107.      their controlling terminal.  Typically, they will be sent signals that
  108.      will cause them to stop, unless they have made other arrangements.  An
  109.      exception is made for members of orphaned process groups. When a member
  110.      of an orphaned process group attempts to access its controlling terminal,
  111.      an error is returned since there is no process to continue it should it
  112.      stop.
  113.  
  114.      If a member of a background process group attempts to _r_e_a_d its
  115.      controlling terminal, its process group will be sent a SSSSIIIIGGGGTTTTTTTTIIIINNNN signal,
  116.      which will normally cause the members of that process group to stop.  If,
  117.      however, the process is ignoring or holding SSSSIIIIGGGGTTTTTTTTIIIINNNN, or is a member of an
  118.      orphaned process group, the _r_e_a_d will fail with eeeerrrrrrrrnnnnoooo set to EEEEIIIIOOOO, and no
  119.      signal will be sent.
  120.  
  121.      If a member of a background process group attempts to _w_r_i_t_e to its
  122.      controlling terminal and the TTTTOOOOSSSSTTTTOOOOPPPP bit is set in the _c__l_f_l_a_g field (see
  123.      below), its process group will be sent a SSSSIIIIGGGGTTTTTTTTOOOOUUUU signal, which will
  124.      normally cause the members of that process group to stop.  If, however,
  125.      the process is ignoring or holding SSSSIIIIGGGGTTTTTTTTOOOOUUUU, the _w_r_i_t_e will succeed.  If
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  137.  
  138.  
  139.  
  140.      the process is not ignoring or holding SSSSIIIIGGGGTTTTTTTTOOOOUUUU and is a member of an
  141.      orphaned process group, the _w_r_i_t_e will fail with eeeerrrrrrrrnnnnoooo set to EEEEIIIIOOOO, and no
  142.      signal will be sent.
  143.  
  144.      If a member of a background process group attempts to invoke an _i_o_c_t_l()
  145.      on its controlling terminal, and that _i_o_c_t_l() will modify terminal
  146.      parameters (e.g.  TTTTCCCCSSSSEEEETTTTAAAA,,,, TTTTCCCCSSSSEEEETTTTAAAAWWWW,,,, TTTTCCCCSSSSEEEETTTTAAAAFFFF, or TTTTIIIIOOOOCCCCSSSSPPPPGGGGRRRRPPPP), and the TTTTOOOOSSSSTTTTOOOOPPPP
  147.      bit is set in the _c__l_f_l_a_g field, its process group will be sent a SSSSIIIIGGGGTTTTTTTTOOOOUUUU
  148.      signal, which will normally cause the members of that process group to
  149.      stop.  If, however, the process is ignoring or holding SSSSIIIIGGGGTTTTTTTTOOOOUUUU, the
  150.      _i_o_c_t_l() will succeed.  If the process is not ignoring or holding SSSSIIIIGGGGTTTTTTTTOOOOUUUU
  151.      and is a member of an orphaned process group, the _i_o_c_t_l() will fail with
  152.      eeeerrrrrrrrnnnnoooo set to EEEEIIIIOOOO, and no signal will be sent.
  153.  
  154.    IIIInnnnppppuuuutttt PPPPrrrroooocccceeeessssssssiiiinnnngggg aaaannnndddd RRRReeeeaaaaddddiiiinnnngggg CCCChhhhaaaarrrraaaacccctttteeeerrrrssss
  155.      A terminal associated with one of these files ordinarily operates in
  156.      full-duplex mode.  Characters may be typed at any time, even while output
  157.      is occurring, and are only lost when the system's character input buffers
  158.      become completely full (which is rare) or when the user has accumulated
  159.      the maximum allowed number of input characters that have not yet been
  160.      read by some program.  Currently, this limit is {MAX_CANON} characters
  161.      (see _p_a_t_h_c_o_n_f(_2)).  When the input limit is reached, the buffer is
  162.      flushed and all the saved characters are thrown away without notice.
  163.  
  164.    CCCCaaaannnnoooonnnniiiiccccaaaallll MMMMooooddddeeee IIIInnnnppppuuuutttt PPPPrrrroooocccceeeessssssssiiiinnnngggg
  165.      Normally, terminal input is processed in units of lines.  A line is
  166.      delimited by a new-line (ASCII LLLLFFFF)))) character, an end-of-file (ASCII EEEEOOOOTTTT))))
  167.      character, or an end-of-line character.  This means that a program
  168.      attempting to _r_e_a_d will be suspended until an entire line has been typed.
  169.      Also, no matter how many characters are requested in the _r_e_a_d call, at
  170.      most one line will be returned.  It is not, however, necessary to _r_e_a_d a
  171.      whole line at once; any number of characters may be requested in a _r_e_a_d,
  172.      even one, without losing information.
  173.  
  174.      During input, erase and kill processing is normally done.  The EEEERRRRAAAASSSSEEEE
  175.      character (Control-H) erases the last character typed.  The WWWWEEEERRRRAAAASSSSEEEE
  176.      character (Control-W) erases the last ``word'' typed in the current input
  177.      line (but not any preceding spaces or tabs). A ``word'' is defined as a
  178.      sequence of non-blank characters, with tabs counted as blanks.  Neither
  179.      EEEERRRRAAAASSSSEEEE or WWWWEEEERRRRAAAASSSSEEEE will erase beyond the beginning of the line.  The KKKKIIIILLLLLLLL
  180.      character (Control-U) kills (deletes) the entire input line, and
  181.      optionally outputs a new-line character.  All these characters operate on
  182.      a key-stroke basis, independently of any backspacing or tabbing that may
  183.      have been done.  The RRRREEEEPPPPRRRRIIIINNNNTTTT character (Control-R) prints a newline
  184.      followed by all unread characters.  The characters are reprinted as if
  185.      they were being echoed; consequently if the EEEECCCCHHHHOOOO flag is not set (see
  186.      below), they are not printed.  The EEEERRRRAAAASSSSEEEE, WWWWEEEERRRRAAAASSSSEEEE, KKKKIIIILLLLLLLL and RRRREEEEPPPPRRRRIIIINNNNTTTT
  187.      characters may be changed.
  188.  
  189.    NNNNoooonnnn----ccccaaaannnnoooonnnniiiiccccaaaallll MMMMooooddddeeee IIIInnnnppppuuuutttt PPPPrrrroooocccceeeessssssssiiiinnnngggg
  190.      In non-canonical mode input processing, input characters are not
  191.      assembled into lines, and erase and kill processing does not occur.  The
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  203.  
  204.  
  205.  
  206.      _MMMM_IIII_NNNN and _TTTT_IIII_MMMM_EEEE values are used to determine how to process the characters
  207.      received.
  208.  
  209.      _MMMM_IIII_NNNN represents the minimum number of characters that should be received
  210.      when the read is satisfied (i.e., when the characters are returned to the
  211.      user).  _TTTT_IIII_MMMM_EEEE is a timer of 0.10-second granularity that is used to
  212.      timeout bursty and short-term data transmissions.  The four possible
  213.      values for _MMMM_IIII_NNNN and _TTTT_IIII_MMMM_EEEE and their interactions are described below.
  214.  
  215.      Case A: _MMMM_IIII_NNNN > 0, _TTTT_IIII_MMMM_EEEE > 0
  216.        In this case, _TTTT_IIII_MMMM_EEEE serves as an intercharacter timer and is activated
  217.        after the first character is received. Since it is an intercharacter
  218.        timer, it is reset after a character is received.  The interaction
  219.        between _MMMM_IIII_NNNN and _TTTT_IIII_MMMM_EEEE is as follows:  as soon as one character is
  220.        received, the intercharacter timer is started.  If _MMMM_IIII_NNNN characters are
  221.        received before the intercharacter timer expires (note that the timer
  222.        is reset upon receipt of each character), the read is satisfied. If the
  223.        timer expires before _MMMM_IIII_NNNN characters are received, the characters
  224.        received to that point are returned to the user.  Note that if _TTTT_IIII_MMMM_EEEE
  225.        expires, at least one character will be returned because the timer
  226.        would not have been enabled unless a character was received.  In this
  227.        case (_MMMM_IIII_NNNN > 0, _TTTT_IIII_MMMM_EEEE > 0), the read sleeps until the _MMMM_IIII_NNNN and _TTTT_IIII_MMMM_EEEE
  228.        mechanisms are activated by the receipt of the first character.  If the
  229.        number of characters read is less than the number of characters
  230.        available, the timer is not reactivated and the subsequent read is
  231.        satisfied immediately.
  232.  
  233.      Case B: _MMMM_IIII_NNNN > 0, _TTTT_IIII_MMMM_EEEE = 0
  234.        In this case, since the value of _TTTT_IIII_MMMM_EEEE is zero, the timer plays no role
  235.        and only _MMMM_IIII_NNNN is significant. A pending read is not satisfied until _MMMM_IIII_NNNN
  236.        characters are received (the pending read sleeps until _MMMM_IIII_NNNN characters
  237.        are received).  A program that uses this case to read record based
  238.        terminal I/O may block indefinitely in the read operation.
  239.  
  240.      Case C: _MMMM_IIII_NNNN = 0, _TTTT_IIII_MMMM_EEEE > 0
  241.        In this case, since _MMMM_IIII_NNNN = 0, _TTTT_IIII_MMMM_EEEE no longer represents an
  242.        intercharacter timer:  it now serves as a read timer that is activated
  243.        as soon as a read is done.  A read is satisfied as soon as a single
  244.        character is received or the read timer expires.  Note that, in this
  245.        case, if the timer expires, no character is returned.  If the timer
  246.        does not expire, the only way the read can be satisfied is if a
  247.        character is received.  In this case, the read will not block
  248.        indefinitely waiting for a character; if no character is received
  249.        within _TTTT_IIII_MMMM_EEEE*.10 seconds after the read is initiated, the read returns
  250.        with zero characters.
  251.  
  252.      Case D: _MMMM_IIII_NNNN = 0, _TTTT_IIII_MMMM_EEEE = 0
  253.        In this case, return is immediate.  The minimum of either the number of
  254.        characters requested or the number of characters currently available is
  255.        returned without waiting for more characters to be input.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  269.  
  270.  
  271.  
  272.    WWWWrrrriiiittttiiiinnnngggg CCCChhhhaaaarrrraaaacccctttteeeerrrrssss
  273.      When one or more characters are written, they are transmitted to the
  274.      terminal as soon as previously-written characters have finished typing.
  275.      Input characters are echoed by putting them in the output queue as they
  276.      arrive.  If a process produces characters more rapidly than they can be
  277.      typed, it will be suspended when its output queue exceeds some limit.
  278.      When the queue has drained down to some threshold, the program is
  279.      resumed.
  280.  
  281.    SSSSppppeeeecccciiiiaaaallll CCCChhhhaaaarrrraaaacccctttteeeerrrrssss
  282.      Certain characters have special functions on input.  These functions and
  283.      their default character values are summarized as follows:
  284.  
  285.      IIIINNNNTTTTRRRR        (Typically, rubout or ASCII DDDDEEEELLLL)))) generates an _i_n_t_e_r_r_u_p_t
  286.                  signal  SSSSIIIIGGGGIIIINNNNTTTT which is sent to all foreground processes with
  287.                  the associated controlling terminal.  Normally, each such
  288.                  process is forced to terminate, but arrangements may be made
  289.                  either to ignore the signal or to receive a trap to an
  290.                  agreed-upon location; see _s_i_g_n_a_l(2).
  291.  
  292.      QQQQUUUUIIIITTTT        (Typically, control-\ or ASCII FFFFSSSS)))) generates a _q_u_i_t signal
  293.                  SSSSIIIIGGGGQQQQUUUUIIIITTTT.  Its treatment is identical to the interrupt signal
  294.                  except that, unless a receiving process has made other
  295.                  arrangements, it will not only be terminated, but a core
  296.                  image file (called ccccoooorrrreeee) will be created in the current
  297.                  working directory.
  298.  
  299.      EEEERRRRAAAASSSSEEEE       (Typically, control-H or backspace) erases the preceding
  300.                  character.  It will not erase beyond the start of a line, as
  301.                  delimited by a NNNNLLLL,,,, EEEEOOOOFFFF,,,, EEEEOOOOLLLL,,,, or EEEEOOOOLLLL2222 character.
  302.  
  303.      KKKKIIIILLLLLLLL        (Typically, control-U) deletes the entire line, as delimited
  304.                  by a NNNNLLLL,,,, EEEEOOOOFFFF,,,, EEEEOOOOLLLL,,,, or EEEEOOOOLLLL2222 character.
  305.  
  306.      EEEEOOOOFFFF         (Typically, control-D or ASCII EEEEOOOOTTTT)))) may be used to generate
  307.                  an end-of-file from a terminal.  When received, all the
  308.                  characters waiting to be read are immediately passed to the
  309.                  program, without waiting for a new-line, and the EEEEOOOOFFFF is
  310.                  discarded.  Thus, if there are no characters waiting, which
  311.                  is to say the EEEEOOOOFFFF occurred at the beginning of a line, zero
  312.                  characters will be passed back, which is the standard end-
  313.                  of-file indication.
  314.  
  315.      NNNNLLLL          (ASCII LLLLFFFF)))) is the normal line delimiter.  It can not be
  316.                  changed or escaped.
  317.  
  318.      EEEEOOOOLLLL         (Typically, ASCII NNNNUUUULLLL)))) is an additional line delimiter, like
  319.                  NNNNLLLL.... It is not normally used.
  320.  
  321.      EEEEOOOOLLLL2222        is another additional line delimiter.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  335.  
  336.  
  337.  
  338.      SSSSTTTTOOOOPPPP        (Typically, control-S or ASCII DDDDCCCC3333)))) can be used to
  339.                  temporarily suspend output.  It is useful with CCCCRRRRTTTT terminals
  340.                  to prevent output from disappearing before it can be read.
  341.                  While output is suspended, SSSSTTTTOOOOPPPP characters are ignored and
  342.                  not read.
  343.  
  344.      SSSSTTTTAAAARRRRTTTT       (Typically, control-Q or ASCII DDDDCCCC1111)))) is used to resume output
  345.                  which has been suspended by a SSSSTTTTOOOOPPPP character.  While output
  346.                  is not suspended, SSSSTTTTAAAARRRRTTTT characters are ignored and not read.
  347.                  The SSSSTTTTAAAARRRRTTTT////SSSSTTTTOOOOPPPP characters can not be changed or escaped in
  348.                  LLLLDDDDIIIISSSSCCCC0000 (see ``Termio Structure''  below).
  349.  
  350.      The following characters have special functions on input when the POSIX
  351.      _t_e_r_m_i_o_s interface is used or when the System V _t_e_r_m_i_o interface is used
  352.      and the line discipline is set to the default of LLLLDDDDIIIISSSSCCCC1111 (see ``Termio
  353.      Structure''  below).  These functions and their default character values
  354.      are summarized as follows:
  355.  
  356.      SSSSUUUUSSSSPPPP        (Control-Z or ASCII SSSSUUUUBBBB)))) generates a SSSSIIIIGGGGTTTTSSSSTTTTPPPP signal which
  357.                  stops all processes in the foreground process group for that
  358.                  terminal.
  359.  
  360.      DDDDSSSSUUUUSSSSPPPP       (Control-Y or ASCII EEEEMMMM) generates a SSSSIIIIGGGGTTTTSSSSTTTTPPPP signal as SSSSUUUUSSSSPPPP
  361.                  does, but the signal is sent when a process in the foreground
  362.                  process group attempts to read the DDDDSSSSUUUUSSSSPPPP character, rather
  363.                  than when it is typed.
  364.  
  365.      LLLLNNNNEEEEXXXXTTTT       (Control-V or ASCII SSSSYYYYNNNN) causes the next character input to
  366.                  treated literally.
  367.  
  368.      WWWWEEEERRRRAAAASSSSEEEE      (Control-W or ASCII EEEETTTTBBBB) erases the preceding white space-
  369.                  delimited word.  It will not erase beyond the start of a
  370.                  line, as delimited by a NNNNLLLL,,,, EEEEOOOOFFFF,,,, EEEEOOOOLLLL,,,, or EEEEOOOOLLLL2222 character.
  371.  
  372.      RRRREEEEPPPPRRRRIIIINNNNTTTT     (Control-R or ASCII DDDDCCCC2222) reprints all characters, preceded by
  373.                  a newline, that have not been read.
  374.  
  375.      FFFFLLLLUUUUSSSSHHHH       (Control-O or ASCII SSSSIIII) when typed during output causes all
  376.                  subsequent output to be discarded.  Typing any character re-
  377.                  enables output.  This character is also known by the POSIX
  378.                  name DDDDIIIISSSSCCCCAAAARRRRDDDD
  379.  
  380.      The character values for IIIINNNNTTTTRRRR,,,, QQQQUUUUIIIITTTT,,,, EEEERRRRAAAASSSSEEEE,,,, WWWWEEEERRRRAAAASSSSEEEE,,,, KKKKIIIILLLLLLLL,,,, RRRREEEEPPPPRRRRIIIINNNNTTTT,,,, EEEEOOOOFFFF,,,,
  381.      EEEEOOOOLLLL,,,, EEEEOOOOLLLL2222,,,, SSSSUUUUSSSSPPPP,,,, DDDDSSSSUUUUSSSSPPPP,,,, SSSSTTTTOOOOPPPP,,,, SSSSTTTTAAAARRRRTTTT,,,, FFFFLLLLUUUUSSSSHHHH////DDDDIIIISSSSCCCCAAAARRRRDDDD,,,, and LLLLNNNNEEEEXXXXTTTT may be
  382.      changed to suit individual tastes (see _s_t_t_y(1)).  If the value of a
  383.      special control character is CCCCNNNNUUUULLLL or ____PPPPOOOOSSSSIIIIXXXX____VVVVDDDDIIIISSSSAAAABBBBLLLLEEEE, the function of
  384.      that special control character is disabled.  The EEEERRRRAAAASSSSEEEE,,,, KKKKIIIILLLLLLLL,,,, and EEEEOOOOFFFF
  385.      characters may be entered literally in LLLLDDDDIIIISSSSCCCC0000 (see ``Termio Structure''
  386.      below), by preceding them with the escape character (\\\\), in which case no
  387.      special function is done and the escape character is not read.  Any of
  388.      the special characters may be entered literally in the _t_e_r_m_i_o_s interface
  389.      or if the _t_e_r_m_i_o interface line discipline is set to LLLLDDDDIIIISSSSCCCC1111 (see ``Termio
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  401.  
  402.  
  403.  
  404.      Structure''  below), by preceding them with the LLLLNNNNEEEEXXXXTTTT character, in which
  405.      case no special function is done and the LLLLNNNNEEEEXXXXTTTT character is not read.
  406.  
  407.    MMMMooooddddeeeemmmm DDDDiiiissssccccoooonnnnnnnneeeecccctttt
  408.      When a modem disconnect is detected, and if CCCCLLLLOOOOCCCCAAAALLLL is not set in the line
  409.      discipline mode (see the discussion of the _c__c_f_l_a_g field below), a SSSSIIIIGGGGHHHHUUUUPPPP
  410.      signal is sent to the terminal's controlling process. Unless other
  411.      arrangements have been made, this signal causes the process to terminate.
  412.      If SSSSIIIIGGGGHHHHUUUUPPPP  is ignored or caught, any subsequent read returns with an
  413.      end-of-file indication until the terminal is closed. Thus, programs that
  414.      read a terminal and test for end-of-file can terminate appropriately
  415.      after a disconnect. Any subsequent write will return -1 and set eeeerrrrrrrrnnnnoooo to
  416.      EEEEIIIIOOOO until the device is closed.
  417.  
  418.      If the controlling process is not in the foreground process group of the
  419.      terminal, a SSSSIIIIGGGGTTTTSSSSTTTTPPPP is sent to the terminal's foreground process group.
  420.      Unless other arrangements have been made, this signal causes the
  421.      processes to stop.
  422.  
  423.      Processes in background process groups that attempt to access the
  424.      controlling terminal after modem disconnect, while the terminal is still
  425.      allocated to the session, will receive appropriate SSSSIIIIGGGGTTTTTTTTOOOOUUUU and SSSSIIIIGGGGTTTTTTTTIIIINNNN
  426.      signals. Unless other arrangements have been made, this signal causes the
  427.      processes to stop.
  428.  
  429.      The controlling terminal will remain in this state until it is
  430.      reinitialized with a successful open by the controlling process, or
  431.      deallocated by the controlling process.
  432.  
  433.    TTTTeeeerrrrmmmmiiiinnnnaaaallll PPPPaaaarrrraaaammmmeeeetttteeeerrrrssss
  434.      The parameters that control the behavior of devices and modules providing
  435.      the tttteeeerrrrmmmmiiiioooossss interface are specified by the tttteeeerrrrmmmmiiiioooossss structure defined by
  436.      <<<<tttteeeerrrrmmmmiiiioooossss....hhhh>>>>.  Several _iiii_oooo_cccc_tttt_llll(2) system calls that fetch or change these
  437.      parameters use this structure, which contains the following members:
  438.  
  439.           struct            termios {
  440.                 tcflag_t    c_iflag;     /* input modes */
  441.                 tcflag_t    c_oflag;     /* output modes */
  442.                 tcflag_t    c_cflag;     /* control modes */
  443.                 tcflag_t    c_lflag;     /* local modes */
  444.                 speed_t     c_ospeed;    /* output speed */
  445.                 speed_t     c_ispeed;    /* input speed; not supported */
  446.                 cc_t        c_cc[NCCS];  /* control chars */
  447.           };
  448.  
  449.      The special control characters are defined by the array _cccc______cccc_cccc. The
  450.      symbolic name NNNNCCCCCCCCSSSS is the size of the control-character array and is also
  451.      defined by <<<<tttteeeerrrrmmmmiiiioooossss....hhhh>>>>.  All space in the array is reserved or used as
  452.      described below.  The relative positions, subscript names, and normal
  453.      default values for each function are as follows:
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  467.  
  468.  
  469.  
  470.           0   VINTR     CINTR    (DEL)
  471.           1   VQUIT     CQUIT    (Control-\)
  472.           2   VERASE    CERASE   (Control-H (Backspace))
  473.           3   VKILL     CKILL    (Control-U)
  474.           4   VEOF      CEOF     (Control-D)
  475.           4   VMIN
  476.           5   VEOL      CEOL     (NUL)
  477.           5   VTIME
  478.           6   VEOL2     CEOL2    (NUL)
  479.           7   VSWTCH    CNSWTCH  (NUL)
  480.           8   VSTART    CSTART   (Control-Q)
  481.           9   VSTOP     CSTOP    (Control-S)
  482.           10  VSUSP     CNSWTCH  (NUL)
  483.           11  VDSUSP    CNUL     (NUL)
  484.           12  VREPRINT  CRPRNT   (Control-R)
  485.           13  VFLUSH    CFLUSH   (Control-O)
  486.           14  VWERASE   CWERASE  (Control-W)
  487.           15  VLNEXT    CLNEXT   (Control-V)
  488.  
  489.  
  490.      IIIInnnnppppuuuutttt MMMMooooddddeeeessss
  491.  
  492.      The _c__i_f_l_a_g field describes the basic terminal input control.  The
  493.      values, functions, and symbolic names of the bits in the _c__i_f_l_a_g field
  494.      are as follows:
  495.  
  496.           IGNBRK   0000001   Ignore break condition.
  497.           BRKINT   0000002   Signal interrupt on break.
  498.           IGNPAR   0000004   Ignore characters with parity errors.
  499.           PARMRK   0000010   Mark parity errors.
  500.           INPCK    0000020   Enable input parity check.
  501.           ISTRIP   0000040   Strip character.
  502.           INLCR    0000100   Map NL to CR on input.
  503.           IGNCR    0000200   Ignore CR.
  504.           ICRNL    0000400   Map CR to NL on input.
  505.           IUCLC    0001000   Map upper-case to lower-case on input.
  506.           IXON     0002000   Enable start/stop output control.
  507.           IXANY    0004000   Enable any character to restart output.
  508.           IXOFF    0010000   Enable start/stop input control.
  509.           IMAXBEL  0020000   Echo BEL on input line too long.
  510.  
  511.      IIIIGGGGNNNNBBBBRRRRKKKK      If IIIIGGGGNNNNBBBBRRRRKKKK is set, a break condition (a character framing
  512.                  error with data all zeros) detected on input is ignored, that
  513.                  is, not put on the input queue and therefore not read by any
  514.                  process.
  515.  
  516.      BBBBRRRRKKKKIIIINNNNTTTT      If IIIIGGGGNNNNBBBBRRRRKKKK is not set and BBBBRRRRKKKKIIIINNNNTTTT is set, the break condition
  517.                  will flush the input and output queues and if the terminal is
  518.                  the controlling terminal of a foreground process group, the
  519.                  break condition will generate a single SSSSIIIIGGGGIIIINNNNTTTT signal to that
  520.                  foreground process group.  If neither IIIIGGGGNNNNBBBBRRRRKKKK nor BBBBRRRRKKKKIIIINNNNTTTT is
  521.                  set, a break condition is read as a single ASCII NNNNUUUULLLL
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  533.  
  534.  
  535.  
  536.                  character, or if PPPPAAAARRRRMMMMRRRRKKKK is set, as: `0377', `0', `0'.
  537.  
  538.      IIIIGGGGNNNNPPPPAAAARRRR      If IIIIGGGGNNNNPPPPAAAARRRR is set, a byte with framing or parity errors (other
  539.                  than break) is ignored.
  540.  
  541.      PPPPAAAARRRRMMMMRRRRKKKK      If PPPPAAAARRRRMMMMRRRRKKKK is set, and IIIIGGGGNNNNPPPPAAAARRRR is not set, a character with a
  542.                  framing or parity error (other than break) is read as the
  543.                  three-character sequence:  `0377', `0', `X', where X is the
  544.                  data of the character received in error.  To avoid ambiguity
  545.                  in this case, if IIIISSSSTTTTRRRRIIIIPPPP is not set, a valid character of
  546.                  `0377' is read as `0377', `0377'.  If neither PPPPAAAARRRRMMMMRRRRKKKK nor
  547.                  IIIIGGGGNNNNPPPPAAAARRRR is set, a framing or parity error (other than break)
  548.                  is read as the single ASCII NNNNUUUULLLL character.
  549.  
  550.      IIIINNNNPPPPCCCCKKKK       If IIIINNNNPPPPCCCCKKKK is set, input parity checking is enabled.  If IIIINNNNPPPPCCCCKKKK
  551.                  is not set, input parity checking is disabled.  This allows
  552.                  output parity generation without input parity errors.
  553.  
  554.      IIIISSSSTTTTRRRRIIIIPPPP      If IIIISSSSTTTTRRRRIIIIPPPP is set, valid input characters are first stripped
  555.                  to 7-bits, otherwise all 8-bits are processed.
  556.  
  557.      IIIINNNNLLLLCCCCRRRR       If IIIINNNNLLLLCCCCRRRR is set, a received NNNNLLLL character is translated into a
  558.                  CCCCRRRR character.
  559.  
  560.      IIIIGGGGNNNNCCCCRRRR       If IIIIGGGGNNNNCCCCRRRR is set, a received CCCCRRRR character is ignored (not
  561.                  read).
  562.  
  563.      IIIICCCCRRRRNNNNLLLL       If IIIICCCCRRRRNNNNLLLL is set, a received CCCCRRRR character is translated into a
  564.                  NNNNLLLL character.
  565.  
  566.      IIIIUUUUCCCCLLLLCCCC       If IIIIUUUUCCCCLLLLCCCC is set, a received upper-case alphabetic character
  567.                  is translated into the corresponding lower-case character.
  568.  
  569.      IIIIXXXXOOOONNNN        If IIIIXXXXOOOONNNN is set, start/stop output control is enabled.  A
  570.                  received SSSSTTTTOOOOPPPP character will suspend output and a received
  571.                  SSSSTTTTAAAARRRRTTTT character will restart output.  The SSSSTTTTOOOOPPPP and SSSSTTTTAAAARRRRTTTT
  572.                  characters will not be read, but will mearly perform flow
  573.                  control functions.
  574.  
  575.      IIIIXXXXAAAANNNNYYYY       If IIIIXXXXAAAANNNNYYYY is set, any input character will restart output that
  576.                  has been suspended.
  577.  
  578.      IIIIXXXXOOOOFFFFFFFF       If IIIIXXXXOOOOFFFFFFFF is set, the system will transmit SSSSTTTTAAAARRRRTTTT////SSSSTTTTOOOOPPPP
  579.                  characters when the input queue is nearly empty/full.
  580.  
  581.      IIIIMMMMAAAAXXXXBBBBEEEELLLL     If IIIIMMMMAAAAXXXXBBBBEEEELLLL is set, the ASCII BBBBEEEELLLL character is echoed if the
  582.                  input stream overflows.  Further input is discarded, but any
  583.                  input already present in the input stream is preserved.
  584.  
  585.      OOOOuuuuttttppppuuuutttt MMMMooooddddeeeessss
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  599.  
  600.  
  601.  
  602.      The _c__o_f_l_a_g field specifies the system treatment of output.  The values,
  603.      functions, and symbolic names of the bits and subfields in the _c__o_f_l_a_g
  604.      field are as follows:
  605.  
  606.           OPOST   0000001   Postprocess output.
  607.           OLCUC   0000002   Map lower case to upper on output.
  608.           ONLCR   0000004   Map NL to CR-NL on output.
  609.           OCRNL   0000010   Map CR to NL on output.
  610.           ONOCR   0000020   No CR output at column 0.
  611.           ONLRET  0000040   NL performs CR function.
  612.           OFILL   0000100   Use fill characters for delay.
  613.           OFDEL   0000200   Fill is DEL, else NUL.
  614.           NLDLY   0000400   Select new-line delays:
  615.           NL0     0
  616.           NL1     0000400
  617.           CRDLY   0003000   Select carriage-return delays:
  618.           CR0     0
  619.           CR1     0001000
  620.           CR2     0002000
  621.           CR3     0003000
  622.           TABDLY  0014000   Select horizontal-tab delays:
  623.           TAB0    0
  624.           TAB1    0004000
  625.           TAB2    0010000
  626.           TAB3    0014000   Expand tabs to spaces.
  627.           BSDLY   0020000   Select backspace delays:
  628.           BS0     0
  629.           BS1     0020000
  630.           VTDLY   0040000   Select vertical-tab delays:
  631.           VT0     0
  632.           VT1     0040000
  633.           FFDLY   0100000   Select form-feed delays:
  634.           FF0     0
  635.           FF1     0100000
  636.  
  637.      OOOOPPPPOOOOSSSSTTTT       If OOOOPPPPOOOOSSSSTTTT is set, output characters are post-processed as
  638.                  indicated by the remaining flags, otherwise characters are
  639.                  transmitted without change.
  640.  
  641.      OOOOLLLLCCCCUUUUCCCC       If OOOOLLLLCCCCUUUUCCCC is set, a lower-case alphabetic character is
  642.                  transmitted as the corresponding upper-case character.  This
  643.                  function is often used in conjunction with IIIIUUUUCCCCLLLLCCCC....
  644.  
  645.      OOOONNNNLLLLCCCCRRRR       If OOOONNNNLLLLCCCCRRRR is set, the NNNNLLLL character is transmitted as the CCCCRRRR----NNNNLLLL
  646.                  character pair.
  647.  
  648.      OOOOCCCCRRRRNNNNLLLL       If OOOOCCCCRRRRNNNNLLLL is set, the CCCCRRRR character is transmitted as the NNNNLLLL
  649.                  character.
  650.  
  651.      OOOONNNNOOOOCCCCRRRR       If OOOONNNNOOOOCCCCRRRR is set, no CCCCRRRR character is transmitted when at
  652.                  column 0 (first position).
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  665.  
  666.  
  667.  
  668.      OOOONNNNLLLLRRRREEEETTTT      If OOOONNNNLLLLRRRREEEETTTT is set, the NNNNLLLL character is assumed to do the
  669.                  carriage-return function; the column pointer will be set to 0
  670.                  and the delays specified for CCCCRRRR will be used.  Otherwise the
  671.                  NNNNLLLL character is assumed to do just the line-feed function;
  672.                  the column pointer will remain unchanged.  The column pointer
  673.                  is also set to 0 if the CCCCRRRR character is actually transmitted.
  674.  
  675.      OOOOFFFFIIIILLLLLLLL       If OOOOFFFFIIIILLLLLLLL is set, fill characters will be transmitted for
  676.                  delay instead of a timed delay.  This is useful for high baud
  677.                  rate terminals which need only a minimal delay.
  678.  
  679.      OOOOFFFFDDDDEEEELLLL       If OOOOFFFFDDDDEEEELLLL is set, the fill character is DDDDEEEELLLL,,,, otherwise NNNNUUUULLLL....
  680.  
  681.      The delay bits specify how long transmission stops to allow for
  682.      mechanical or other movement when certain characters are sent to the
  683.      terminal.  In all cases a value of 0 indicates no delay.
  684.  
  685.      The actual delays depend on line speed and system load.
  686.  
  687.      NNNNLLLLDDDDLLLLYYYY       Newline delay type 0 (NNNNLLLL0000) selects no delay.  Newline delay
  688.                  type 1 (NNNNLLLL1111) lasts about 0.10 seconds.  If OOOONNNNLLLLRRRREEEETTTT is set, the
  689.                  carriage-return delays are used instead of the new-line
  690.                  delays.  If OOOOFFFFIIIILLLLLLLL is set, two fill characters will be
  691.                  transmitted.
  692.  
  693.      CCCCRRRRDDDDLLLLYYYY       Carriage-return delay type 0 (CCCCRRRR0000) selects no delay.
  694.                  Carriage-return delay type 1 (CCCCRRRR1111) is dependent on the
  695.                  current column position, type 2 (CCCCRRRR2222) is about 0.10 seconds,
  696.                  and type 3 (CCCCRRRR3333) is about 0.15 seconds.  If OOOOFFFFIIIILLLLLLLL is set,
  697.                  delay type 1 transmits two fill characters, and type 2, four
  698.                  fill characters.
  699.  
  700.      TTTTAAAABBBBDDDDLLLLYYYY      Horizontal-tab delay type 0 (TTTTAAAABBBB0000) selects no delay.
  701.                  Horizontal-tab delay type 1 (TTTTAAAABBBB1111) is dependent on the
  702.                  current column position.  Type 2 (TTTTAAAABBBB2222) is about 0.10
  703.                  seconds.  Type 3 (TTTTAAAABBBB3333) specifies that tabs are to be
  704.                  expanded into spaces.  If OOOOFFFFIIIILLLLLLLL is set, two fill characters
  705.                  will be transmitted for any delay.
  706.  
  707.      BBBBSSSSDDDDLLLLYYYY       Backspace delay type 0 (BBBBSSSS0000) selects no delay.  Backspace
  708.                  delay type 1 (BBBBSSSS1111) lasts about 0.05 seconds.  If OOOOFFFFIIIILLLLLLLL is
  709.                  set, one fill character will be transmitted.
  710.  
  711.      VVVVTTTTDDDDLLLLYYYY       Vertical-tab delay type 0 (VVVVTTTT0000) selects no delay.  Vertical-
  712.                  tab delay type 1 (VVVVTTTT1111) lasts about 2.0 seconds.
  713.  
  714.      FFFFFFFFDDDDLLLLYYYY       Form-feed delay type 0 (FFFFFFFF0000) selects no delay.  Form-feed
  715.                  delay type 0 (FFFFFFFF0000) lasts about 2.0 seconds.
  716.  
  717.      CCCCoooonnnnttttrrrroooollll MMMMooooddddeeeessss
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  731.  
  732.  
  733.  
  734.      The _c__c_f_l_a_g field describes the hardware control of the terminal.  The
  735.      values, functions, and symbolic names of the bits and subfields in the
  736.      _c__c_f_l_a_g field are as follows:
  737.  
  738.           CBAUD        000000017   No longer supported; see "Old termio" below.
  739.           CSIZE        000000060   Character size:
  740.           CS5          0           5 bits
  741.           CS6          000000020   6 bits
  742.           CS7          000000040   7 bits
  743.           CS8          000000060   8 bits
  744.           CSTOPB       000000100   Send two stop bits, else one.
  745.           CREAD        000000200   Enable receiver.
  746.           PARENB       000000400   Parity enable.
  747.           PARODD       000001000   Odd parity, else even.
  748.           HUPCL        000002000   Hang up on last close.
  749.           CLOCAL       000004000   Local line, else dial-up.
  750.           RCV1EN       000010000   Not supported.
  751.           XMT1EN       000020000   Not supported.
  752.           LOBLK        000040000   Block layer output.
  753.           XCLUDE       000100000   Not supported.
  754.           CIBAUD       003600000   Not supported.
  755.           PAREXT       004000000   Not supported.
  756.           CNEW_RTSCTS  010000000   Use RTS/CTS flow control
  757.  
  758.      CCCCSSSSIIIIZZZZEEEE         The CCCCSSSSIIIIZZZZEEEE bits specify the character size in bits for both
  759.                    transmission and reception.  This size does not include the
  760.                    parity bit, if any.
  761.  
  762.      CCCCSSSSTTTTOOOOPPPPBBBB        If CCCCSSSSTTTTOOOOPPPPBBBB is set, two stop bits are used, otherwise one
  763.                    stop bit.  For example, at 110 baud, two stops bits are
  764.                    required.
  765.  
  766.      CCCCRRRREEEEAAAADDDD         If CCCCRRRREEEEAAAADDDD is set, the receiver is enabled.  Otherwise no
  767.                    characters will be received.
  768.  
  769.      PPPPAAAARRRREEEENNNNBBBB        If PPPPAAAARRRREEEENNNNBBBB is set, parity generation and detection is
  770.                    enabled and a parity bit is added to each character.
  771.  
  772.      PPPPAAAARRRROOOODDDDDDDD        If parity is enabled, the PPPPAAAARRRROOOODDDDDDDD flag specifies odd parity
  773.                    if set, otherwise even parity is used.
  774.  
  775.      HHHHUUUUPPPPCCCCLLLL         If HHHHUUUUPPPPCCCCLLLL is set, the line will be disconnected when the
  776.                    last process with the line open closes it or terminates.
  777.                    That is, the data-terminal-ready signal will not be
  778.                    asserted.
  779.  
  780.      CCCCLLLLOOOOCCCCAAAALLLL        If CCCCLLLLOOOOCCCCAAAALLLL is set, the line is assumed to be a local, direct
  781.                    connection with no modem control.  Otherwise modem control
  782.                    is assumed.
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  797.  
  798.  
  799.  
  800.      LLLLOOOOBBBBLLLLKKKK         If LLLLOOOOBBBBLLLLKKKK is set, the output of a job control layer will be
  801.                    blocked when it is not the current layer.  Otherwise the
  802.                    output generated by that layer will be multiplexed onto the
  803.                    current layer.
  804.  
  805.      CCCCNNNNEEEEWWWW____RRRRTTTTSSSSCCCCTTTTSSSS   If CCCCNNNNEEEEWWWW____RRRRTTTTSSSSCCCCTTTTSSSS is set, and the communications port supports
  806.                    it, RTS/CTS handshaking will be used.  When the input queue
  807.                    becomes nearly full, RTS will be dropped.  RTS will be
  808.                    reasserted when the input queue has drained sufficiently.
  809.                    Output is suspended when CTS is lowered and restarted when
  810.                    CTS is raised.  This flag is automatically set on the ttttttttyyyyffff
  811.                    serial port devices; see _s_e_r_i_a_l(7).
  812.  
  813.      LLLLooooccccaaaallll MMMMooooddddeeeessss
  814.  
  815.      The _c__l_f_l_a_g field of the argument structure is used by the line
  816.      discipline to control terminal functions.  The following flags are
  817.      currently defined:
  818.  
  819.           ISIG     0000001   Enable signals.
  820.           ICANON   0000002   Canonical input (erase and kill processing).
  821.           XCASE    0000004   Canonical upper/lower presentation.
  822.           ECHO     0000010   Enable echo.
  823.           ECHOE    0000020   Echo erase character as BS-SP-BS.
  824.           ECHOK    0000040   Echo NL after kill character.
  825.           ECHONL   0000100   Echo NL.
  826.           NOFLSH   0000200   Disable flush after interrupt or quit.
  827.           IEXTEN   0000400   Enable extended functions (not used by IRIX).
  828.           ECHOCTL  0001000   Echo control characters as ^char, delete as ^?.
  829.           ECHOPRT  0002000   Echo erase character as character erased.
  830.           ECHOKE   0004000   BS-SP-BS entire line on line kill.
  831.           FLUSHO   0020000   Output being flushed.
  832.           PENDIN   0040000   Retype pending input at next read or input char.
  833.           TOSTOP   0100000   Send SIGTTOU for background output.
  834.  
  835.      IIIISSSSIIIIGGGG        If IIIISSSSIIIIGGGG is set, each input character is checked against the
  836.                  special control characters IIIINNNNTTTTRRRR,,,, SSSSUUUUSSSSPPPP,,,, DDDDSSSSUUUUSSSSPPPP,,,, and QQQQUUUUIIIITTTT.... If an
  837.                  input character matches one of these control characters, the
  838.                  function associated with that character is performed.  If
  839.                  IIIISSSSIIIIGGGG is not set, no checking is done.  Thus these special
  840.                  input functions are possible only if IIIISSSSIIIIGGGG is set.  These
  841.                  functions may be disabled individually by changing the value
  842.                  of the control character to CCCCNNNNUUUULLLL or ____PPPPOOOOSSSSIIIIXXXX____VVVVDDDDIIIISSSSAAAABBBBLLLLEEEE
  843.  
  844.      IIIICCCCAAAANNNNOOOONNNN      If IIIICCCCAAAANNNNOOOONNNN is set, canonical processing is enabled.  This
  845.                  enables the erase and kill edit functions, and the assembly
  846.                  of input characters into lines delimited by NNNNLLLL, EEEEOOOOFFFF,,,, EEEEOOOOLLLLand
  847.                  EEEEOOOOLLLL2222.  If IIIICCCCAAAANNNNOOOONNNN is not set, read requests are satisfied
  848.                  directly from the input queue.  A read will not be satisfied
  849.                  until at least MMMMIIIINNNN characters have been received or the
  850.                  timeout value TTTTIIIIMMMMEEEE has expired between characters.  This
  851.                  allows fast bursts of input to be read efficiently while
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  863.  
  864.  
  865.  
  866.                  still allowing single character input.  The MMMMIIIINNNN and TTTTIIIIMMMMEEEE
  867.                  values are stored in the position for the EEEEOOOOFFFF and EEEEOOOOLLLL
  868.                  characters, respectively.  The time value represents tenths
  869.                  of seconds.
  870.  
  871.      XXXXCCCCAAAASSSSEEEE       If XXXXCCCCAAAASSSSEEEE is set, and if IIIICCCCAAAANNNNOOOONNNN is set, an upper-case letter
  872.                  is accepted on input by preceding it with a \\\\ character, and
  873.                  is output preceded by a \\\\ character.  In this mode, the
  874.                  following escape sequences are generated on output and
  875.                  accepted on input:
  876.  
  877.                     for:      use:
  878.  
  879.                     `         \'
  880.                     |         \!
  881.                     ~         \^
  882.                     {         \(
  883.                     }         \)
  884.                     \         \\
  885.  
  886.                  For example, ``A'' is input as ``\a'', ``\n'' as ``\\n'', and
  887.                  ``\N'' as ``\\\n''.
  888.  
  889.      EEEECCCCHHHHOOOO        If EEEECCCCHHHHOOOO is set, characters are echoed as received.
  890.  
  891.      When IIIICCCCAAAANNNNOOOONNNN is set, the following echo functions are possible.
  892.  
  893.      EEEECCCCHHHHOOOOEEEE       If EEEECCCCHHHHOOOO and EEEECCCCHHHHOOOOEEEE are set, and EEEECCCCHHHHOOOOPPPPRRRRTTTT is not set, the EEEERRRRAAAASSSSEEEE
  894.                  and WWWWEEEERRRRAAAASSSSEEEE characters are echoed as one or more ASCII BBBBSSSS SSSSPPPP
  895.                  BBBBSSSS,,,, which will clear the last character(s) from a CCCCRRRRTTTT screen.
  896.                  If EEEECCCCHHHHOOOOEEEE is set and EEEECCCCHHHHOOOO is not set, the erase character is
  897.                  echoed as ASCII SSSSPPPP BBBBSSSS....
  898.  
  899.      EEEECCCCHHHHOOOOKKKK       If EEEECCCCHHHHOOOOKKKK is set, and EEEECCCCHHHHOOOOKKKKEEEE is not set, the NNNNLLLL character will
  900.                  be echoed after the kill character to emphasize that the line
  901.                  will be deleted.  Note that an escape character or an LLLLNNNNEEEEXXXXTTTT
  902.                  character preceding the erase or kill character removes any
  903.                  special function (see ``Special Characters'' above).
  904.  
  905.      EEEECCCCHHHHOOOONNNNLLLL      If EEEECCCCHHHHOOOONNNNLLLL is set, the NNNNLLLL character will be echoed even if
  906.                  EEEECCCCHHHHOOOO is not set.  This is useful for terminals set to local
  907.                  echo (so-called half duplex).  Unless escaped, the EEEEOOOOFFFF
  908.                  character is not echoed.  Because EEEEOOOOTTTT is the default EEEEOOOOFFFF
  909.                  character, this prevents terminals that respond to EEEEOOOOTTTT from
  910.                  hanging up.
  911.  
  912.      NNNNOOOOFFFFLLLLSSSSHHHH      If NNNNOOOOFFFFLLLLSSSSHHHH is set, the normal flush of the input and output
  913.                  queues associated with the IIIINNNNTTTTRRRR, QQQQUUUUIIIITTTT, and SSSSUUUUSSSSPPPP characters
  914.                  will not be done.
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  929.  
  930.  
  931.  
  932.      TTTTOOOOSSSSTTTTOOOOPPPP      If TTTTOOOOSSSSTTTTOOOOPPPP is set, the signal SSSSIIIIGGGGTTTTTTTTOOOOUUUU is sent to a process
  933.                  that tries to write to its controlling terminal if it is not
  934.                  in the foreground process group for that terminal.  This
  935.                  signal normally stops the process.  Otherwise, the output
  936.                  generated by that process is output to the current output
  937.                  stream.  Processes that are blocking or ignoring SSSSIIIIGGGGTTTTTTTTOOOOUUUU
  938.                  signals are excepted and allowed to produce output and the
  939.                  SSSSIIIIGGGGTTTTTTTTOOOOUUUU signal is not sent.
  940.  
  941.      EEEECCCCHHHHOOOOCCCCTTTTLLLL     If EEEECCCCHHHHOOOOCCCCTTTTLLLL is set, all control characters (characters with
  942.                  codes between 0 and 37 octal) other than ASCII TTTTAAAABBBB, ASCII NNNNLLLL,
  943.                  the SSSSTTTTAAAARRRRTTTT character, the SSSSTTTTOOOOPPPP character, ASCII CCCCRRRR, and ASCII
  944.                  BBBBSSSS are echoed as ^X, where X is the character given by adding
  945.                  100 octal to the code of the control character (so that the
  946.                  character with octal code 1 is echoed as ^A), and the ASCII
  947.                  DDDDEEEELLLL character, with code 177 octal is echoed as ^?.
  948.  
  949.      EEEECCCCHHHHOOOOPPPPRRRRTTTT     If EEEECCCCHHHHOOOO and EEEECCCCHHHHOOOOPPPPRRRRTTTT are set, the first EEEERRRRAAAASSSSEEEE or WWWWEEEERRRRAAAASSSSEEEE
  950.                  character in a sequence echoes as a backslash (\), followed
  951.                  by the characters being erased.  Subsequent EEEERRRRAAAASSSSEEEE or WWWWEEEERRRRAAAASSSSEEEE
  952.                  characters echo the characters being erased in reverse order.
  953.                  The next non-erase character causes a slash (/) to be typed
  954.                  before it is echoed.
  955.  
  956.      EEEECCCCHHHHOOOOKKKKEEEE      If EEEECCCCHHHHOOOOKKKKEEEE is set, the kill character is echoed by erasing
  957.                  each character on the line from the screen (using the
  958.                  mechanism selected by EEEECCCCHHHHOOOOEEEE and EEEECCCCHHHHOOOOPPPPRRRRTTTT).
  959.  
  960.      FFFFLLLLUUUUSSSSHHHHOOOO      If FFFFLLLLUUUUSSSSHHHHOOOO is set, data written to the terminal is discarded.
  961.                  This bit is set when the FFFFLLLLUUUUSSSSHHHH////DDDDIIIISSSSCCCCAAAARRRRDDDD character is typed.  A
  962.                  program can cancel the effect of typing the FFFFLLLLUUUUSSSSHHHH////DDDDIIIISSSSCCCCAAAARRRRDDDD
  963.                  character by clearing FFFFLLLLUUUUSSSSHHHHOOOO.
  964.  
  965.      PPPPEEEENNNNDDDDIIIINNNN      If PPPPEEEENNNNDDDDIIIINNNN is set, any input that has not yet been read is
  966.                  reprinted when the next character arrives as input.
  967.  
  968.      SSSSppppeeeeeeeedddd
  969.  
  970.      The _c__o_s_p_e_e_d and _c__i_s_p_e_e_d fields control the output and input speeds of
  971.      the line, respectively, in bits per second (bps). No current SGI devices
  972.      support setting output and input speeds to different values, however, so
  973.      _c__i_s_p_e_e_d is not supported.
  974.  
  975.      B0        0        Hang up
  976.      B50       50       50 bps
  977.      B75       75       75 bps
  978.      B110      110      110 bps
  979.      B134      134      134 bps
  980.      B150      150      150 bps
  981.      B200      200      200 bps
  982.      B300      300      300 bps
  983.      B600      600      600 bps
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  995.  
  996.  
  997.  
  998.      B1200     1200     1200 bps
  999.      B1800     1800     1800 bps
  1000.      B2400     2400     2400 bps
  1001.      B4800     4800     4800 bps
  1002.      B9600     9600     9600 bps
  1003.      B19200    19200    19200 bps
  1004.      B38400    38400    38400 bps
  1005.      B57600    57600    57600 bps
  1006.      B76800    76800    76800 bps
  1007.      B115200   115200   115200 bps
  1008.  
  1009.      SSPEED    B9600    Default baud rate.
  1010.  
  1011.      The B* names are provided only for convenience; applications may use
  1012.      plain integer values in _c__o_s_p_e_e_d and _c__i_s_p_e_e_d.
  1013.  
  1014.      Note that capabilities of serial ports vary; not all devices support all
  1015.      bit rates.  Some devices support additional rates.
  1016.  
  1017.    TTTTeeeerrrrmmmmiiiioooo SSSSttttrrrruuuuccccttttuuuurrrreeee
  1018.      The System V tttteeeerrrrmmmmiiiioooo structure is used by some iiiiooooccccttttlllls; it is defined by
  1019.      <<<<ssssyyyyssss////tttteeeerrrrmmmmiiiioooo....hhhh>>>> and includes the following members:
  1020.  
  1021.           struct            termio {
  1022.                 tcflag_t    c_iflag;     /* input modes */
  1023.                 tcflag_t    c_oflag;     /* output modes */
  1024.                 tcflag_t    c_cflag;     /* control modes */
  1025.                 tcflag_t    c_lflag;     /* local modes */
  1026.                 speed_t     c_ospeed;    /* output speed */
  1027.                 speed_t     c_ispeed;    /* input speed; not supported */
  1028.                 char        c_line;      /* line discipline */
  1029.                 cc_t        c_cc[NCCS];  /* control chars */
  1030.           };
  1031.  
  1032.      The _c__l_i_n_e field defines the _l_i_n_e _d_i_s_c_i_p_l_i_n_e used to interpret control
  1033.      characters.  A line discipline is associated with a family of
  1034.      interpretations.  For example, LLLLDDDDIIIISSSSCCCC0000 is the standard System V set of
  1035.      interpretations, while LLLLDDDDIIIISSSSCCCC1111 is similar to the interpretations used in
  1036.      the 4.3BSD tty driver.  In LLLLDDDDIIIISSSSCCCC1111,,,,
  1037.  
  1038.      +o  additional control characters are available,
  1039.  
  1040.      +o  control characters which are not editing characters are echoed as '^'
  1041.         followed by the equivalent letter,
  1042.  
  1043.      +o  backspacing does not back up into the prompt,
  1044.  
  1045.      +o  input is re-typed when backspacing encounters a confusion between what
  1046.         the user and the computer have typed, and
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  1061.  
  1062.  
  1063.  
  1064.      +o  job control is available.
  1065.  
  1066.      The symbolic name NNNNCCCCCCCCSSSS is the size of the control-character array and is
  1067.      also defined by <<<<tttteeeerrrrmmmmiiiioooo....hhhh>>>>.  The relative positions, subscript names, and
  1068.      typical default values for each function are as follows:
  1069.  
  1070.           0   VINTR     CINTR    (DEL)
  1071.           1   VQUIT     CQUIT    (Control-\)
  1072.           2   VERASE    CERASE   (Control-H (backspace))
  1073.           3   VKILL     CKILL    (Control-U)
  1074.           4   VEOF      CEOF     (Control-D (EOT))
  1075.           4   VMIN
  1076.           5   VEOL      NUL
  1077.           5   VTIME
  1078.           6   VEOL2     NUL
  1079.  
  1080.      If the line discipline (_c__l_i_n_e) is set to LLLLDDDDIIIISSSSCCCC1111,,,, then additional control
  1081.      characters are defined:
  1082.  
  1083.           7   VSWTCH    CNSWTCH  (NUL)
  1084.           8   VSTART    CSTART   (Control-Q)
  1085.           9   VSTOP     CSTOP    (Control-S)
  1086.           10  VSUSP     CNSWTCH  (NUL)
  1087.           11  VDSUSP    CNUL     (NUL)
  1088.           12  VREPRINT  CRPRNT   (Control-R)
  1089.           13  VFLUSH    CFLUSH   (Control-O)
  1090.           14  VWERASE   CWERASE  (Control-W)
  1091.           15  VLNEXT    CLNEXT   (Control-V)
  1092.  
  1093.  
  1094.    OOOOlllldddd tttteeeerrrrmmmmiiiioooo aaaannnndddd tttteeeerrrrmmmmiiiioooossss
  1095.      For compatibility with existing binaries, MIPS ABI programs, and programs
  1096.      that cannot be ported to use the new tttteeeerrrrmmmmiiiioooo or tttteeeerrrrmmmmiiiioooossss structures, the
  1097.      old interfaces are retained.  Existing binaries automatically use the old
  1098.      interfaces.  By defining ____OOOOLLLLDDDD____TTTTEEEERRRRMMMMIIIIOOOOSSSS at compile time (before including
  1099.      <<<<tttteeeerrrrmmmmiiiioooossss....hhhh>>>>, <<<<tttteeeerrrrmmmmiiiioooo....hhhh>>>>, or <<<<ssssyyyyssss////ttttttttyyyyddddeeeevvvv....hhhh>>>>), the old interfaces are in
  1100.      effect.  The old tttteeeerrrrmmmmiiiioooossss structure is defined as follows:
  1101.  
  1102.           struct            termios {
  1103.                 tcflag_t    c_iflag;     /* input modes */
  1104.                 tcflag_t    c_oflag;     /* output modes */
  1105.                 tcflag_t    c_cflag;     /* control modes */
  1106.                 tcflag_t    c_lflag;     /* local modes */
  1107.                 cc_t        c_cc[NCCS];  /* control chars */
  1108.           };
  1109.  
  1110.      and the old tttteeeerrrrmmmmiiiioooo structure is defined as follows:
  1111.  
  1112.           struct            termio {
  1113.                 tcflag_t    c_iflag;     /* input modes */
  1114.                 tcflag_t    c_oflag;     /* output modes */
  1115.                 tcflag_t    c_cflag;     /* control modes */
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  1127.  
  1128.  
  1129.  
  1130.                tcflag_t     c_lflag;     /* local modes */
  1131.                 char        c_line;      /* line discipline */
  1132.                 cc_t        c_cc[NCCS];  /* control chars */
  1133.           };
  1134.  
  1135.      The members are as described above, except for _c__c_f_l_a_g, in which CCCCBBBBAAAAUUUUDDDD
  1136.      encodes the bit rate:
  1137.  
  1138.           CBAUD   000000017   Baud rate:
  1139.           B0      0           Hang up
  1140.           B50     000000001   50 baud
  1141.           B75     000000002   75 baud
  1142.           B110    000000003   110 baud
  1143.           B134    000000004   134 baud
  1144.           B150    000000005   150 baud
  1145.           B200    000000006   200 baud
  1146.           B300    000000007   300 baud
  1147.           B600    000000010   600 baud
  1148.           B1200   000000011   1200 baud
  1149.           B1800   000000012   1800 baud
  1150.           B2400   000000013   2400 baud
  1151.           B4800   000000014   4800 baud
  1152.           B9600   000000015   9600 baud
  1153.           B19200  000000016   19200 baud
  1154.           EXTA    000000016   External A
  1155.           B38400  000000017   38400 baud
  1156.           EXTB    000000017   External B
  1157.  
  1158.           SSPEED  B9600       Default baud rate.
  1159.  
  1160.    MMMMiiiixxxxiiiinnnngggg oooolllldddd aaaannnndddd nnnneeeewwww iiiinnnntttteeeerrrrffffaaaacccceeeessss
  1161.      If a bit rate is set using the new tttteeeerrrrmmmmiiiioooo or tttteeeerrrrmmmmiiiioooossss interfaces (or the
  1162.      POSIX interfaces described in termios(3)) that cannot be represented in
  1163.      the old CCCCBBBBAAAAUUUUDDDD field, then the old tttteeeerrrrmmmmiiiioooo, tttteeeerrrrmmmmiiiioooossss, and POSIX interfaces
  1164.      will return ____IIIINNNNVVVVAAAALLLLIIIIDDDD____BBBBAAAAUUUUDDDD in the CCCCBBBBAAAAUUUUDDDD field.  If the bit rate is set to
  1165.      ____IIIINNNNVVVVAAAALLLLIIIIDDDD____BBBBAAAAUUUUDDDD using the old interfaces, the bit rate change will be
  1166.      ignored, and the actual line speed will remain unchanged.  This allows
  1167.      many programs that do not explicitly manage bit rates to work with the
  1168.      new interfaces without change.  And, it allows some old programs to work
  1169.      with new, fast bit rates without change. For example, sequences similar
  1170.      to the following (which are very common) work with either old or new
  1171.      interfaces, even if the line is currently set to a baud rate than cannot
  1172.      be represented in the old CCCCBBBBAAAAUUUUDDDD field:
  1173.  
  1174.              struct termio t;
  1175.  
  1176.              ioctl(fd, TCGETA, &t);
  1177.              t.c_cflag |= CREAD;
  1178.              t.c_lflag &= ~ECHO;
  1179.              /* t.c_cflag & CBAUD may contain _INVALID_BAUD, but, if so, */
  1180.              /* this TCSETA will not affect the actual bit rate */
  1181.              ioctl(fd, TCSETA, &t);
  1182.  
  1183.  
  1184.  
  1185.                                                                        PPPPaaaaggggeeee 11118888
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  1193.  
  1194.  
  1195.  
  1196.    SSSSyyyysssstttteeeemmmm CCCCaaaallllllllssss
  1197.      The _i_o_c_t_l()s supported by devices and SSSSTTTTRRRREEEEAAAAMMMMSSSS modules providing the
  1198.      tttteeeerrrrmmmmiiiioooo and tttteeeerrrrmmmmiiiioooossss interface are listed below.
  1199.  
  1200.      TTTTCCCCGGGGEEEETTTTAAAA       The argument is a pointer to a tttteeeerrrrmmmmiiiioooo structure.  Get the
  1201.                   parameters associated with the terminal and store in the
  1202.                   tttteeeerrrrmmmmiiiioooo structure referenced by aaaarrrrgggg.
  1203.  
  1204.      TTTTCCCCSSSSEEEETTTTAAAA       The argument is a pointer to a tttteeeerrrrmmmmiiiioooo structure.  Set the
  1205.                   parameters associated with the terminal from the structure
  1206.                   referenced by aaaarrrrgggg.  The change is immediate.
  1207.  
  1208.      TTTTCCCCSSSSEEEETTTTAAAAWWWW      The argument is a pointer to a tttteeeerrrrmmmmiiiioooo structure.  Wait for
  1209.                   the output to drain before setting the new parameters.  This
  1210.                   form should be used when changing parameters that will
  1211.                   affect output.
  1212.  
  1213.      TTTTCCCCSSSSEEEETTTTAAAAFFFF      The argument is a pointer to a tttteeeerrrrmmmmiiiioooo structure.  Wait for
  1214.                   the output to drain, then flush the input queue and set the
  1215.                   new parameters.
  1216.  
  1217.      TTTTCCCCGGGGEEEETTTTSSSS       The argument is a pointer to a tttteeeerrrrmmmmiiiioooossss structure.  Get the
  1218.                   parameters associated with the terminal and store in the
  1219.                   tttteeeerrrrmmmmiiiioooossss structure referenced by aaaarrrrgggg.  See _t_c_g_e_t_a_t_t_r(3).
  1220.  
  1221.      TTTTCCCCSSSSEEEETTTTSSSS       The argument is a pointer to a tttteeeerrrrmmmmiiiioooossss structure.  Set the
  1222.                   parameters associated with the terminal from the structure
  1223.                   referenced by aaaarrrrgggg.  The change is immediate.  See
  1224.                   _t_c_s_e_t_a_t_t_r(3).
  1225.  
  1226.      TTTTCCCCSSSSEEEETTTTSSSSWWWW      The argument is a pointer to a tttteeeerrrrmmmmiiiioooossss structure.  Wait for
  1227.                   the output to drain before setting the new parameters.  This
  1228.                   form should be used when changing parameters that will
  1229.                   affect output.  See _t_c_s_e_t_a_t_t_r(3).
  1230.  
  1231.      TTTTCCCCSSSSEEEETTTTSSSSFFFF      The argument is a pointer to a tttteeeerrrrmmmmiiiioooossss structure.  Wait for
  1232.                   the output to drain, then flush the input queue and set the
  1233.                   new parameters.  See _t_c_s_e_t_a_t_t_r(3).
  1234.  
  1235.      TTTTCCCCSSSSBBBBRRRRKKKK       The argument is an iiiinnnntttt value.  Wait for the output to drain.
  1236.                   If _a_r_g is 0, then send a break (zero bits for 0.25 seconds).
  1237.                   See _t_c_s_e_n_d_b_r_e_a_k(3) and _t_c_d_r_a_i_n(3).
  1238.  
  1239.      TTTTCCCCXXXXOOOONNNNCCCC       Start/stop control.  The argument is an iiiinnnntttt value.  If _a_r_g
  1240.                   is 0, suspend output; if 1, restart suspended output; if 2,
  1241.                   suspend input; if 3, restart suspended input.  See
  1242.                   _t_c_f_l_o_w(3).
  1243.  
  1244.      TTTTCCCCFFFFLLLLSSSSHHHH       The argument is an iiiinnnntttt value.  If _a_r_g is 0, flush the input
  1245.                   queue; if 1, flush the output queue; if 2, flush both the
  1246.                   input and output queues. See _t_c_f_l_u_s_h(3).
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                                                        PPPPaaaaggggeeee 11119999
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  1259.  
  1260.  
  1261.  
  1262.      TTTTIIIIOOOOCCCCNNNNOOOOTTTTTTTTYYYY    Disconnect calling process from terminal and session.
  1263.  
  1264.      TTTTIIIIOOOOCCCCSSSSTTTTIIII      Simulate terminal input: _a_r_g points to a character which the
  1265.                   system pretends has been typed on the terminal.
  1266.  
  1267.      TTTTIIIIOOOOCCCCSSSSPPPPGGGGRRRRPPPP    Set process group of tty:  _a_r_g is a pointer to a ppppiiiidddd____tttt which
  1268.                   is the value to which the process group ID for this terminal
  1269.                   will be set. See _t_c_s_e_t_p_g_r_p(_3).
  1270.  
  1271.      TTTTIIIIOOOOCCCCGGGGPPPPGGGGRRRRPPPP    Get process group of tty:  _a_r_g is a pointer to a ppppiiiidddd____tttt into
  1272.                   which is placed the process group ID of the process group
  1273.                   for which this terminal is the controlling terminal. See
  1274.                   _t_c_g_e_t_p_g_r_p(_3).
  1275.  
  1276.      TTTTIIIIOOOOCCCCGGGGSSSSIIIIDDDD     _a_r_g is a pointer to a ppppiiiidddd____tttt into which is placed the session
  1277.                   ID of the terminal.
  1278.  
  1279.      TTTTIIIIOOOOCCCCFFFFLLLLUUUUSSSSHHHH    If the iiiinnnntttt pointed to by _a_r_g has a zero value, all
  1280.                   characters waiting in input or output queues are flushed.
  1281.                   Otherwise, the value of the iiiinnnntttt is for the FREAD and FWRITE
  1282.                   bits defined in <_s_y_s/_f_i_l_e._h>; if the FREAD bit is set, all
  1283.                   characters waiting in input queues are flushed, and if the
  1284.                   FWRITE bit is set, all characters waiting in output queues
  1285.                   are flushed.
  1286.  
  1287.      TTTTIIIIOOOOCCCCMMMMGGGGEEEETTTT     The argument is a pointer to an iiiinnnntttt sized bit field into
  1288.                   which the current state of the modem status lines is stored.
  1289.                   This _i_o_c_t_l() is supported only on special files representing
  1290.                   serial ports.  See _s_e_r_i_a_l(7).  The symbolic names of the
  1291.                   bits returned in _a_r_g are defined by <_s_y_s/_t_e_r_m_i_o_s._h>:
  1292.  
  1293.                             TIOCM_LE    line enable
  1294.                             TIOCM_DTR   data terminal ready
  1295.                             TIOCM_RTS   request to send
  1296.                             TIOCM_ST    secondary transmit
  1297.                             TIOCM_SR    secondary receive
  1298.                             TIOCM_CTS   clear to send
  1299.                             TIOCM_CAR   carrier detect
  1300.                             TIOCM_CD    synonym for TIOCM_CAR
  1301.                             TIOCM_RNG   ring
  1302.                             TIOCM_RI    synonym for TIOCM_RNG
  1303.                             TIOCM_DSR   data set ready
  1304.  
  1305.  
  1306.                 Not all of these are necessarily supported by any particular
  1307.                 device.
  1308.  
  1309.      TTTTIIIIOOOOCCCCMMMMSSSSEEEETTTT   The argument is a pointer to an iiiinnnntttt sized bit field used to
  1310.                 set the state of the modem status lines. If a bit is set, the
  1311.                 coresponding modem status line is turned on.  If a bit is
  1312.                 cleared the coresponding modem status line is turned off.
  1313.                 This _i_o_c_t_l() is supported only on special files representing
  1314.  
  1315.  
  1316.  
  1317.                                                                        PPPPaaaaggggeeee 22220000
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. TTTTEEEERRRRMMMMIIIIOOOO((((7777))))                                                            TTTTEEEERRRRMMMMIIIIOOOO((((7777))))
  1325.  
  1326.  
  1327.  
  1328.                 serial ports.  See _s_e_r_i_a_l(7).  The symbolic names of the bits
  1329.                 used in _a_r_g are the same as for TTTTIIIIOOOOCCCCMMMMGGGGEEEETTTT....   Only DTR and RTS
  1330.                 are settable with this _i_o_c_t_l().  Not all of these are
  1331.                 necessarily supported by any particular device.
  1332.  
  1333.      TTTTIIIIOOOOCCCCGGGGWWWWIIIINNNNSSSSZZZZ Get window size: _a_r_g is a pointer to a structure of the
  1334.                 following form:  Window size structure:
  1335.  
  1336.                 struct winsize {
  1337.                           unsigned short ws_row;  /* rows, in chars */
  1338.                           unsigned short ws_col;  /* columns, in chars */
  1339.                           unsigned short ws_xpixel;  /* horiz. pixels */
  1340.                           unsigned short ws_ypixel;  /* vert. pixels */
  1341.                 };
  1342.  
  1343.      TTTTIIIIOOOOCCCCSSSSWWWWIIIINNNNSSSSZZZZ Set window size:  _a_r_g is a pointer to a structure of a _w_i_n_s_i_z_e
  1344.                 structure.
  1345.  
  1346.      FFFFIIIIOOOONNNNRRRREEEEAAAADDDD   Return the number of bytes currently available to read.  _a_r_g
  1347.                 is a pointer to an _i_n_t.
  1348.  
  1349.      FFFFIIIIOOOONNNNBBBBIIIIOOOO    Enables or disables non-blocking mode, according to the
  1350.                 boolean value of the contents of _a_r_g.  _a_r_g is a pointer to an
  1351.                 _i_n_t.  Enabling this mode has the same effect as the OOOO____NNNNDDDDEEEELLLLAAAAYYYY
  1352.                 flag for _o_p_e_n(2).
  1353.  
  1354.      The following _i_o_c_t_l calls apply only to pseudo terminals; see _p_t_y(7M) for
  1355.      their descriptions:
  1356.  
  1357.           TTTTIIIIOOOOCCCCPPPPKKKKTTTT, TTTTIIIIOOOOCCCCPPPPKKKKTTTT____DDDDAAAATTTTAAAA, TTTTIIIIOOOOCCCCPPPPKKKKTTTT____FFFFLLLLUUUUSSSSHHHHRRRREEEEAAAADDDD, TTTTIIIIOOOOCCCCPPPPKKKKTTTT____FFFFLLLLUUUUSSSSHHHHWWWWRRRRIIIITTTTEEEE,
  1358.           TTTTIIIIOOOOCCCCPPPPKKKKTTTT____SSSSTTTTOOOOPPPP, TTTTIIIIOOOOCCCCPPPPKKKKTTTT____SSSSTTTTAAAARRRRTTTT, TTTTIIIIOOOOCCCCPPPPKKKKTTTT____NNNNOOOOSSSSTTTTOOOOPPPP and TTTTIIIIOOOOCCCCPPPPKKKKTTTT____DDDDOOOOSSSSTTTTOOOOPPPP.
  1359.  
  1360.  
  1361. NNNNOOOOTTTTEEEESSSS
  1362.      Of the _i_o_c_t_l commands listed above, all except TTTTCCCCGGGGEEEETTTTAAAA and TTTTCCCCGGGGEEEETTTTSSSS alter
  1363.      the state of the terminal.  For this reason, a background job which
  1364.      issues any of commands except TTTTCCCCGGGGEEEETTTTAAAA or TTTTCCCCGGGGEEEETTTTSSSS will be suspended.  Refer
  1365.      to _c_s_h(1) or _k_s_h(1) for more information about job control.
  1366.  
  1367. FFFFIIIILLLLEEEESSSS
  1368.      /dev/tty*
  1369.  
  1370. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1371.      stty(1), fork(2), ioctl(2), setsid(2), setpgrp(2), signal(2), tcdrain(3),
  1372.      tcflow(3), tcflush(3), tcgetattr(3), tcgetpgrp(3), tcsendbreak(3),
  1373.      tcsetattr(3), tcsetpgrp(3), pty(7M), serial(7), termios(3)
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.                                                                        PPPPaaaaggggeeee 22221111
  1384.  
  1385.  
  1386.  
  1387.